package com.cwl.mc.handler;

import java.util.List;

/**
 * mc base handler
 *
 * @author cwivan
 * @version 1.0
 * @date 2019/3/11
 */
public class McBaseHandler {


	private void filterSql(StringBuffer findSql, String field, List<String> ids){
		if (ids.isEmpty()) {
			findSql.append(" and ").append(field).append(" = '").append("' ");
			return;
		} else {
			findSql.append(" and ( ");
			for (int index = 0; index < ids.size(); index++) {
				if (index > 0) {
					findSql.append(" or ");
				}
				String id = ids.get(index);
				findSql.append(field).append(" = '").append(id).append("' ");
			}
			findSql.append(" ) ");
		}
	}

}
